
import axios from '@/libs/request/axios'

// 查询当前模型下所有指标，树结构
export const getByModelCode = (modelCode) => {
    return axios.request({
        url: '/channel/grade/gradeModelElement/getByModelCode',
        data: { modelCode },
        method: 'post'
    })
}

// 新增 
// 保存评级模型指标（指标分为一级大类和二级小类，页面从不同的+按钮触发）
export const saveModelElement = (params) => {
    return axios.request({
        url: '/channel/grade/gradeModelElement/save',
        data: params,
        method: 'post'
    })
}

// 修改评级模型指标（指标分为一级大类和二级小类）
export const editModelElement = (params) => {
    return axios.request({
        url: '/channel/grade/gradeModelElement/edit',
        data: params,
        method: 'post'
    })
}

// 删除评级模型指标（指标分为一级大类和二级小类） /grade/gradeModelElement/delete
export const deleteModelElement = (modelCode, elementNo) => {
    return axios.request({
        url: '/channel/grade/gradeModelElement/delete',
        data: { modelCode, elementNo },
        method: 'post'
    })
}

// 获取字典大类type 
export const getDataDicType = () => {
    return axios.request({
        url: '/channel/grade/gradeModelElement/getDataDicType',
        method: 'post'
    })
}
